package com.mz.ozy.mvp.model;

import android.content.Context;


import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class TCoinsModel {


    public Observable<ResponseBody> getCode(Context context,String phone) {
        Map<String, String> maps = new HashMap<>();
        maps.put("userphone", phone);
        maps.put("actionType", "T");
       // maps.put("countryCode", SPUtils.getInstance(context).getString(Constants.SPName.COUNTRYCODE, ""));
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10001, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    public Observable<ResponseBody> getTbInfo(Context context) {
        Map<String, String> maps = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10014, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    public Observable<ResponseBody> onTb(Context context, String coinCode, String address, String coinNum, String code) {
        Map<String, String> maps = new HashMap<>();
        maps.put("type", coinCode);
        maps.put("account", address);
        maps.put("amt", coinNum);
        maps.put("password", code);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10016, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    public Observable<ResponseBody> newOnTb(Context context, String amount, String name, String account, String type, String padPwd) {
        Map<String, String> maps = new HashMap<>();
        maps.put("amount", amount);
        maps.put("name", name);
        maps.put("account", account);
        maps.put("type", type);
        maps.put("paypwd", padPwd);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10405, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }


}
